<template>
  <div class="my-friends-page">
    <div class="my-nav-cs my-friends-page-nav">
      <div v-if="title == '2'" class="my-friends-page-nav-title fl">我的粉丝</div>
      <div v-if="title == '3'" class="my-friends-page-nav-title fl">我的关注</div>
      <div class="cf"></div>
    </div>
    <ul class="my-friends-list" v-for="item in items">
      <li :key="item.id">
        <div class="my-friends-base-info"><span class="my-friends-pic-wrap fl"><img src="/default-photo.jpg"/></span>
          <span class="my-friends-name fl">{{item.nickname}}</span> <span class="my-friends-tag  fl"><span>{{item.level}}</span></span><span
            class="cf"></span></div>
        <div class="my-friends-instr">{{item.autograph}}</div>
      </li>
    </ul>
    <div v-if="!loading" @click="loadMore" class="my-loading">
      加载更多
    </div>
    <div v-if="loading" class="my-loading">
      正在加载 ......
    </div>
  </div>
</template>
<script>
  export default {
    data () {
      return {
        loading: false,
        items: [
          {
            id: 1,
            nickname: '张盼枝',
            level: '攻城狮',
            autograph: '水电费水电费水电费水电费水电费水电费是的是的范德萨非电商范德萨范德萨范德萨是打发第三方到时分是打发第三方锁定发是打发第三方锁定水电费水电费是'
          },
          {
            id: 2,
            nickname: '张盼枝',
            level: '攻城狮',
            autograph: '水电费水电费水电费水电费水电费水电费是的是的范德萨非电商范德萨范德萨范德萨是打发第三方到时分是打发第三方锁定发是打发第三方锁定水电费水电费是'
          },
          {
            id: 3,
            nickname: '张盼枝',
            level: '攻城狮',
            autograph: '水电费水电费水电费水电费水电费水电费是的是的范德萨非电商范德萨范德萨范德萨是打发第三方到时分是打发第三方锁定发是打发第三方锁定水电费水电费是'
          }
        ]
      }
    },
    props: ['title'],
    methods: {
      loadMore () {
        this.loading = true
        setTimeout(() => {
          let _id = Math.random() + ''
          let _item = {
            id: _id,
            nickname: '张盼枝',
            level: '攻城狮',
            autograph: '水电费水电费水电费水电费水电费水电费是的是的范德萨非电商范德萨范德萨范德萨是打发第三方到时分是打发第三方锁定发是打发第三方锁定水电费水电费是'
          }
          this.items.push(_item)
          this.loading = false
        }, 3000)
      }
    },
    computed: {}
  }
</script>
<style>
  .my-loading {
    color: #ffffff;
    text-align: center;
    font-size: 1.2em;
    height: 35px;
    line-height: 35px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 10px;
    background-color: #13BA31;
    margin-top: 10px;
  }
.my-friends-page{
  padding-bottom: 30px;
}
  .my-friends-list li {
    border-bottom: 1px solid #ececec;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .my-friends-base-info > span {
    height: 50px;
    line-height: 50px;
  }

  .my-friends-pic-wrap {
    width: 50px;
    height: 50px;
    overflow: hidden;
    border-radius: 5px;
  }

  .my-friends-pic-wrap > img {
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.6s;
    border-radius: 5px;
  }

  .my-friends-pic-wrap > img:hover {
    transform: scale(1.4);
  }

  .my-friends-name {
    font-size: 1.3em;
    font-weight: 700;
    color: #707070;
    margin: auto 20px;
  }

  .my-friends-tag > span {
    height: 20px;
    line-height: 20px;
    padding: 1px 5px;
    color: #303030;
    background-color: #ececec;
    font-size: 1.2em;
  }

  .my-friends-instr {
    padding-left: 70px;
    font-size: 1.25em;
    color: #707070;
  }

  .my-nav-cs {
    border-bottom: 1px solid #f3f3f3;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 1.25em;
    font-weight: 600;
  }

  @media all and (max-width: 766px) {
    .my-nav-cs {
      display: none;
    }
    .my-friends-name{
      font-size: 1.2em;
    }
    .my-friends-instr{
      font-size: 1em;
    }
  }
</style>
